<?php

class Helper_Idgenerator
{
	public function getid()
	{
		$auth = Zend_Auth::getInstance();
		if ($auth->hasIdentity()) {
			$name = $auth->getIdentity()->vorname;
			
			
			return md5($name . uniqid());
		}
		else{
			throw new Exception('User ist nicht eingeloggt.');
		}
	}
	
	public function getiduser(){
		return uniqid();
	}


	public function land($id)
	{
		$db = Zend_Db_Table::getDefaultAdapter();
		$entry = new Zend_Db_Select($db);
		$entry->from('country');
		$entry->where('country.id = ?', $id);
		$country = $entry->query()->fetch();
		return $country;
	}
}
?>